package dog

import (
	"net/http"
	"fmt"
	"io/ioutil"
)

type LastWordHttpGet struct {
	url string
}

func (this *LastWordHttpGet) SetCmd(cmd string) {
	this.url = cmd
}

func (this *LastWordHttpGet) Execute() {
	response, err := http.Get(this.url)
	if err != nil {
		fmt.Println(err)
		return
	}
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
